Optimal. Leaf size=227 \[ -\frac {b \cosh \left (a+b x-c x^2\right )}{4 c^2}-\frac {x \cosh \left (a+b x-c x^2\right )}{2 c}-\frac {b^2 e^{a+\frac {b^2}{4 c}} \sqrt {\pi } \text {Erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{16 c^{5/2}}-\frac {e^{a+\frac {b^2}{4 c}} \sqrt {\pi } \text {Erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{3/2}}+\frac {b^2 e^{-a-\frac {b^2}{4 c}} \sqrt {\pi } \text {Erfi}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{16 c^{5/2}}-\frac {e^{-a-\frac {b^2}{4 c}} \sqrt {\pi } \text {Erfi}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{3/2}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 227, normalized size of antiderivative = 1.00, number of steps
used = 12, number of rules used = 7, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.438, Rules used = {5494, 5490,
5482, 2266, 2236, 2235, 5483} \begin {gather*} -\frac {\sqrt {\pi } b^2 e^{a+\frac {b^2}{4 c}} \text {Erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{16 c^{5/2}}-\frac {\sqrt {\pi } e^{a+\frac {b^2}{4 c}} \text {Erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{3/2}}+\frac {\sqrt {\pi } b^2 e^{-a-\frac {b^2}{4 c}} \text {Erfi}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{16 c^{5/2}}-\frac {\sqrt {\pi } e^{-a-\frac {b^2}{4 c}} \text {Erfi}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{3/2}}-\frac {b \cosh \left (a+b x-c x^2\right )}{4 c^2}-\frac {x \cosh \left (a+b x-c x^2\right )}{2 c} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2235
Rule 2236
Rule 2266
Rule 5482
Rule 5483
Rule 5490
Rule 5494
Rubi steps
\begin {align*} \int x^2 \sinh \left (a+b x-c x^2\right ) \, dx &=-\frac {x \cosh \left (a+b x-c x^2\right )}{2 c}+\frac {\int \cosh \left (a+b x-c x^2\right ) \, dx}{2 c}+\frac {b \int x \sinh \left (a+b x-c x^2\right ) \, dx}{2 c}\\ &=-\frac {b \cosh \left (a+b x-c x^2\right )}{4 c^2}-\frac {x \cosh \left (a+b x-c x^2\right )}{2 c}+\frac {b^2 \int \sinh \left (a+b x-c x^2\right ) \, dx}{4 c^2}+\frac {\int e^{a+b x-c x^2} \, dx}{4 c}+\frac {\int e^{-a-b x+c x^2} \, dx}{4 c}\\ &=-\frac {b \cosh \left (a+b x-c x^2\right )}{4 c^2}-\frac {x \cosh \left (a+b x-c x^2\right )}{2 c}+\frac {b^2 \int e^{a+b x-c x^2} \, dx}{8 c^2}-\frac {b^2 \int e^{-a-b x+c x^2} \, dx}{8 c^2}+\frac {e^{-a-\frac {b^2}{4 c}} \int e^{\frac {(-b+2 c x)^2}{4 c}} \, dx}{4 c}+\frac {e^{a+\frac {b^2}{4 c}} \int e^{-\frac {(b-2 c x)^2}{4 c}} \, dx}{4 c}\\ &=-\frac {b \cosh \left (a+b x-c x^2\right )}{4 c^2}-\frac {x \cosh \left (a+b x-c x^2\right )}{2 c}-\frac {e^{a+\frac {b^2}{4 c}} \sqrt {\pi } \text {erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{3/2}}-\frac {e^{-a-\frac {b^2}{4 c}} \sqrt {\pi } \text {erfi}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{3/2}}-\frac {\left (b^2 e^{-a-\frac {b^2}{4 c}}\right ) \int e^{\frac {(-b+2 c x)^2}{4 c}} \, dx}{8 c^2}+\frac {\left (b^2 e^{a+\frac {b^2}{4 c}}\right ) \int e^{-\frac {(b-2 c x)^2}{4 c}} \, dx}{8 c^2}\\ &=-\frac {b \cosh \left (a+b x-c x^2\right )}{4 c^2}-\frac {x \cosh \left (a+b x-c x^2\right )}{2 c}-\frac {b^2 e^{a+\frac {b^2}{4 c}} \sqrt {\pi } \text {erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{16 c^{5/2}}-\frac {e^{a+\frac {b^2}{4 c}} \sqrt {\pi } \text {erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{3/2}}+\frac {b^2 e^{-a-\frac {b^2}{4 c}} \sqrt {\pi } \text {erfi}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{16 c^{5/2}}-\frac {e^{-a-\frac {b^2}{4 c}} \sqrt {\pi } \text {erfi}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{3/2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.21, size = 152, normalized size = 0.67 \begin {gather*} \frac {-4 \sqrt {c} (b+2 c x) \cosh (a+x (b-c x))+\left (b^2-2 c\right ) \sqrt {\pi } \text {Erfi}\left (\frac {-b+2 c x}{2 \sqrt {c}}\right ) \left (-\cosh \left (a+\frac {b^2}{4 c}\right )+\sinh \left (a+\frac {b^2}{4 c}\right )\right )+\left (b^2+2 c\right ) \sqrt {\pi } \text {Erf}\left (\frac {-b+2 c x}{2 \sqrt {c}}\right ) \left (\cosh \left (a+\frac {b^2}{4 c}\right )+\sinh \left (a+\frac {b^2}{4 c}\right )\right )}{16 c^{5/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.47, size = 244, normalized size = 1.07
method | result | size |
risch | \(-\frac {x \,{\mathrm e}^{c \,x^{2}-b x -a}}{4 c}-\frac {b \,{\mathrm e}^{c \,x^{2}-b x -a}}{8 c^{2}}-\frac {b^{2} \sqrt {\pi }\, {\mathrm e}^{-\frac {4 a c +b^{2}}{4 c}} \erf \left (x \sqrt {-c}+\frac {b}{2 \sqrt {-c}}\right )}{16 c^{2} \sqrt {-c}}+\frac {\sqrt {\pi }\, {\mathrm e}^{-\frac {4 a c +b^{2}}{4 c}} \erf \left (x \sqrt {-c}+\frac {b}{2 \sqrt {-c}}\right )}{8 c \sqrt {-c}}-\frac {x \,{\mathrm e}^{-c \,x^{2}+b x +a}}{4 c}-\frac {b \,{\mathrm e}^{-c \,x^{2}+b x +a}}{8 c^{2}}-\frac {b^{2} \sqrt {\pi }\, {\mathrm e}^{\frac {4 a c +b^{2}}{4 c}} \erf \left (-\sqrt {c}\, x +\frac {b}{2 \sqrt {c}}\right )}{16 c^{\frac {5}{2}}}-\frac {\sqrt {\pi }\, {\mathrm e}^{\frac {4 a c +b^{2}}{4 c}} \erf \left (-\sqrt {c}\, x +\frac {b}{2 \sqrt {c}}\right )}{8 c^{\frac {3}{2}}}\) | \(244\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 834 vs.
\(2 (179) = 358\).
time = 0.49, size = 834, normalized size = 3.67 \begin {gather*} -\frac {1}{3} \, x^{3} \sinh \left (c x^{2} - b x - a\right ) - \frac {{\left (\frac {\sqrt {\pi } {\left (2 \, c x - b\right )} b^{3} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {\frac {{\left (2 \, c x - b\right )}^{2}}{c}}\right ) - 1\right )}}{\sqrt {\frac {{\left (2 \, c x - b\right )}^{2}}{c}} \left (-c\right )^{\frac {7}{2}}} - \frac {6 \, b^{2} c e^{\left (-\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}}{\left (-c\right )^{\frac {7}{2}}} - \frac {12 \, {\left (2 \, c x - b\right )}^{3} b \Gamma \left (\frac {3}{2}, \frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}{\left (\frac {{\left (2 \, c x - b\right )}^{2}}{c}\right )^{\frac {3}{2}} \left (-c\right )^{\frac {7}{2}}} - \frac {8 \, c^{2} \Gamma \left (2, \frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}{\left (-c\right )^{\frac {7}{2}}}\right )} b e^{\left (a + \frac {b^{2}}{4 \, c}\right )}}{96 \, \sqrt {-c}} - \frac {{\left (\frac {\sqrt {\pi } {\left (2 \, c x - b\right )} b^{4} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {\frac {{\left (2 \, c x - b\right )}^{2}}{c}}\right ) - 1\right )}}{\sqrt {\frac {{\left (2 \, c x - b\right )}^{2}}{c}} \left (-c\right )^{\frac {9}{2}}} - \frac {8 \, b^{3} c e^{\left (-\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}}{\left (-c\right )^{\frac {9}{2}}} - \frac {24 \, {\left (2 \, c x - b\right )}^{3} b^{2} \Gamma \left (\frac {3}{2}, \frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}{\left (\frac {{\left (2 \, c x - b\right )}^{2}}{c}\right )^{\frac {3}{2}} \left (-c\right )^{\frac {9}{2}}} - \frac {32 \, b c^{2} \Gamma \left (2, \frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}{\left (-c\right )^{\frac {9}{2}}} - \frac {16 \, {\left (2 \, c x - b\right )}^{5} \Gamma \left (\frac {5}{2}, \frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}{\left (\frac {{\left (2 \, c x - b\right )}^{2}}{c}\right )^{\frac {5}{2}} \left (-c\right )^{\frac {9}{2}}}\right )} c e^{\left (a + \frac {b^{2}}{4 \, c}\right )}}{96 \, \sqrt {-c}} - \frac {{\left (\frac {\sqrt {\pi } {\left (2 \, c x - b\right )} b^{3} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {-\frac {{\left (2 \, c x - b\right )}^{2}}{c}}\right ) - 1\right )}}{\sqrt {-\frac {{\left (2 \, c x - b\right )}^{2}}{c}} c^{\frac {7}{2}}} + \frac {6 \, b^{2} e^{\left (\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}}{c^{\frac {5}{2}}} - \frac {12 \, {\left (2 \, c x - b\right )}^{3} b \Gamma \left (\frac {3}{2}, -\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}{\left (-\frac {{\left (2 \, c x - b\right )}^{2}}{c}\right )^{\frac {3}{2}} c^{\frac {7}{2}}} - \frac {8 \, \Gamma \left (2, -\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}{c^{\frac {3}{2}}}\right )} b e^{\left (-a - \frac {b^{2}}{4 \, c}\right )}}{96 \, \sqrt {c}} + \frac {1}{96} \, {\left (\frac {\sqrt {\pi } {\left (2 \, c x - b\right )} b^{4} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {-\frac {{\left (2 \, c x - b\right )}^{2}}{c}}\right ) - 1\right )}}{\sqrt {-\frac {{\left (2 \, c x - b\right )}^{2}}{c}} c^{\frac {9}{2}}} + \frac {8 \, b^{3} e^{\left (\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}}{c^{\frac {7}{2}}} - \frac {24 \, {\left (2 \, c x - b\right )}^{3} b^{2} \Gamma \left (\frac {3}{2}, -\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}{\left (-\frac {{\left (2 \, c x - b\right )}^{2}}{c}\right )^{\frac {3}{2}} c^{\frac {9}{2}}} - \frac {32 \, b \Gamma \left (2, -\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}{c^{\frac {5}{2}}} - \frac {16 \, {\left (2 \, c x - b\right )}^{5} \Gamma \left (\frac {5}{2}, -\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}{\left (-\frac {{\left (2 \, c x - b\right )}^{2}}{c}\right )^{\frac {5}{2}} c^{\frac {9}{2}}}\right )} \sqrt {c} e^{\left (-a - \frac {b^{2}}{4 \, c}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 467 vs.
\(2 (179) = 358\).
time = 0.42, size = 467, normalized size = 2.06 \begin {gather*} -\frac {4 \, c^{2} x + 2 \, {\left (2 \, c^{2} x + b c\right )} \cosh \left (c x^{2} - b x - a\right )^{2} - \sqrt {\pi } {\left ({\left (b^{2} - 2 \, c\right )} \cosh \left (c x^{2} - b x - a\right ) \cosh \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right ) - {\left (b^{2} - 2 \, c\right )} \cosh \left (c x^{2} - b x - a\right ) \sinh \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right ) + {\left ({\left (b^{2} - 2 \, c\right )} \cosh \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right ) - {\left (b^{2} - 2 \, c\right )} \sinh \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right )\right )} \sinh \left (c x^{2} - b x - a\right )\right )} \sqrt {-c} \operatorname {erf}\left (\frac {{\left (2 \, c x - b\right )} \sqrt {-c}}{2 \, c}\right ) - \sqrt {\pi } {\left ({\left (b^{2} + 2 \, c\right )} \cosh \left (c x^{2} - b x - a\right ) \cosh \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right ) + {\left (b^{2} + 2 \, c\right )} \cosh \left (c x^{2} - b x - a\right ) \sinh \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right ) + {\left ({\left (b^{2} + 2 \, c\right )} \cosh \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right ) + {\left (b^{2} + 2 \, c\right )} \sinh \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right )\right )} \sinh \left (c x^{2} - b x - a\right )\right )} \sqrt {c} \operatorname {erf}\left (\frac {2 \, c x - b}{2 \, \sqrt {c}}\right ) + 4 \, {\left (2 \, c^{2} x + b c\right )} \cosh \left (c x^{2} - b x - a\right ) \sinh \left (c x^{2} - b x - a\right ) + 2 \, {\left (2 \, c^{2} x + b c\right )} \sinh \left (c x^{2} - b x - a\right )^{2} + 2 \, b c}{16 \, {\left (c^{3} \cosh \left (c x^{2} - b x - a\right ) + c^{3} \sinh \left (c x^{2} - b x - a\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int x^{2} \sinh {\left (a + b x - c x^{2} \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.41, size = 167, normalized size = 0.74 \begin {gather*} -\frac {\frac {\sqrt {\pi } {\left (b^{2} + 2 \, c\right )} \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {c} {\left (2 \, x - \frac {b}{c}\right )}\right ) e^{\left (\frac {b^{2} + 4 \, a c}{4 \, c}\right )}}{\sqrt {c}} + 2 \, {\left (c {\left (2 \, x - \frac {b}{c}\right )} + 2 \, b\right )} e^{\left (-c x^{2} + b x + a\right )}}{16 \, c^{2}} + \frac {\frac {\sqrt {\pi } {\left (b^{2} - 2 \, c\right )} \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {-c} {\left (2 \, x - \frac {b}{c}\right )}\right ) e^{\left (-\frac {b^{2} + 4 \, a c}{4 \, c}\right )}}{\sqrt {-c}} - 2 \, {\left (c {\left (2 \, x - \frac {b}{c}\right )} + 2 \, b\right )} e^{\left (c x^{2} - b x - a\right )}}{16 \, c^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int x^2\,\mathrm {sinh}\left (-c\,x^2+b\,x+a\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________